<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0" />
	<title>主页</title>
	<link rel="stylesheet" href="../../static/weixin/css/weui.min.css" th:href="@{/weixin/css/weui.min.css}" />
	<link rel="stylesheet" href="../../static/weixin/css/common.css" th:href="@{/weixin/css/common.css}" />
	<script type="text/javascript" src="../../static/weixin/js/zepto.min.js" th:src="@{/weixin/js/zepto.min.js}"></script>
	<script type="text/javascript" src="../../static/weixin/js/weui.min.js" th:src="@{/weixin/js/weui.min.js}"></script>
	<script type="text/javascript" src="../../static/weixin/js/fastclick.min.js" th:src="@{/weixin/js/fastclick.min.js}"></script>
    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" th:src="@{/weixin/js/jweixin-1.0.0.js}"></script>
</head>

<body>
 <div class="container" id="container">
	<!-- Main content -->
		<div class="page">
			<div class="page__bd" style="height: 100%;">
				<div class="weui-tab">
					<div class="weui-tab__panel">
						<div class="weui-panel">
							<div class="weui-cells__title">客户信息</div>
							<div class="weui-cells">
								<div class="weui-cell" id="avatarCell">
									<div class="weui-cell__bd weui-cell_primary">
										<p>姓名</p>
									</div>
									<div class="weui-cell__ft" th:text="${customer.name}">龚自豪</div>
								</div>
								<div class="weui-cell">
									<div class="weui-cell__bd weui-cell_primary">
										<p>手机号</p>
									</div>
									<div class="weui-cell__ft" th:text="${customer.phone}">bear</div>
								</div>
								<div class="weui-cell no_access">
									<div class="weui-cell__bd weui-cell_primary">
										<p>微信号</p>
									</div>
									<div class="weui-cell__ft" th:text="${customer.weixin}">bear</div>
								</div>
							</div>
							<div class="weui-cells__title">孩子信息</div>
							<div class="weui-cells">
								<div class="weui-cell ">
									<div class="weui-cell__bd weui-cell_primary">
										<p>孩子性别</p>
									</div>
									<div class="weui-cell__ft" th:text="${customer.sex}">男</div>
								</div>
								<div class="weui-cell">
									<div class="weui-cell__bd weui-cell_primary">
										<p>出生日期</p>
									</div>
									<div class="weui-cell__ft" th:text="${#calendars.format(customer.birthday,'yyyy/MM/dd')}">奥地利 维也纳</div>
								</div>
								<div class="weui-cell">
									<div class="weui-cell__bd weui-cell_primary">
										<p>出生医院</p>
									</div>
									<div class="weui-cell__ft" th:text="${customer.hospital}">奥地利 维也纳</div>
								</div>
							</div>
							<div class="weui-cells__title">预约信息</div>
							<div class="weui-cells">
								<div class="weui-cell">
									<div class="weui-cell__bd weui-cell_primary">
										<p>时间</p>
									</div>
									<div class="weui-cell__ft" th:text="${#calendars.format(reservation.reserveTime,'yyyy/MM/dd HH:mm:ss')}">20101010</div>
								</div>
								<div class="weui-cell">
									<div class="weui-cell__bd weui-cell_primary">
										<p>地址</p>
									</div>
									<div class="weui-cell__ft" th:text="${reservation.address}">备注备注备注备注备注备注备注备注备注</div>
								</div>
							</div>
							<div class="weui-cells__title">备注</div>
							<div class="weui-cells">
								<div class="weui-cell">
									<div class="weui-cell__bd weui-cell_primary">
										<p th:text="${reservation.comment}">备注备注备注备注备注备注备注备注备注备注备注备注
										备注备注备注备注备注备注备注备注备注备注备注备注
										备注备注备注备注备注</p>
									</div>
								</div>
							</div>
							
						</div>
						<div style="padding:15px"  th:switch="${reservation.state}">
							<a th:case="0" th:href="@{'/weixin/state/'+${reservation.id}}" class="weui-btn weui-btn_primary">开始服务</a>
							<a th:case="1" th:href="@{'/weixin/state/'+${reservation.id}}" class="weui-btn weui-btn_primary">结束服务</a>
							<a th:case="2" href="###" id="customerfeedback" class="weui-btn weui-btn_primary">客户评价</a>
							<a th:case="3" th:href="@{'/weixin/staffFeedBack/'+${reservation.id}}" class="weui-btn weui-btn_primary">催乳师反馈</a>
						</div> 
					</div>
					<div class="weui-tabbar">
						<a href="javascript:;" class="weui-tabbar__item weui-bar__item_on">
							<img th:src="@{/weixin/images/icon_tabbar.png}" alt="" class="weui-tabbar__icon" />
							<p class="weui-tabbar__label">客户列表</p>
						</a> 
						<a href="javascript:;" class="weui-tabbar__item"> 
							<img th:src="@{/weixin/images/icon_tabbar.png}" alt="" class="weui-tabbar__icon" />
							<p class="weui-tabbar__label">我的信息</p>
						</a>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div class="weui-share" onclick="$(this).fadeOut();$(this).removeClass('fadeOut')">
	<div class="weui-share-box">
	将该页面分享给客户进行评价<i></i>
	</div>
	</div> 
	
	<script th:if="${reservation.state == 2}" th:inline="javascript">
		var jsconfig = /*[[${config}]]*/ null;
		var appid = /*[[${appid}]]*/ null;
		var url = /*[[${url}]]*/ null;

		$(function(){
			wx.config({
				debug: true, 
				appId: appid, 
				timestamp: jsconfig["timestamp"], 
				nonceStr: jsconfig["noncestr"], 
				signature: jsconfig["signature"],
				jsApiList: ["onMenuShareAppMessage"]
			});

			wx.ready(function(){
			  wx.checkJsApi({
			    jsApiList: [
			      'onMenuShareAppMessage'
			    ],
				success: function (res) {
					wx.onMenuShareAppMessage({
						title: '请评价催乳师的服务',
						desc: '描述',
						link: url,
						success: function (res) {
							$.weui.alert('分享成功，等待客户评价');
						},
						fail: function (res) {
							$.weui.alert(JSON.stringify(res));
						}
					});
				}
			 });
			});

			$("#customerfeedback").click(function(){
				$('.weui-share').show().addClass('fadeIn');
			});
    	});

</script>
	
	<script type="text/javascript">
	$(function(){
		FastClick.attach(document.body);
	})
	</script>
	</body>
</html>
